package com.csii.user.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.csii.core.constant.CacheConstant;
import com.csii.core.system.vo.ComboModel;
import com.csii.core.system.vo.DictModel;
import com.csii.core.system.vo.LoginUser;
import com.csii.core.system.vo.SysDepartModel;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

/**
 * @Description TODO
 * @Date 2020/9/1 20:56
 * @Created by Ian
 * @Contact: 19107614@qq.com
 */
public interface ISysBaseAPI {
    void addLog(String LogContent, Integer logType, Integer operatetype);

    @Cacheable(cacheNames= CacheConstant.SYS_USERS_CACHE, key="T(com.csii.core.util.TenantContext).getTenantDefaultString() + #username")
    LoginUser getUserByName(String username);

    LoginUser getUserById(String id);

    List<String> getRolesByUsername(String username);

    List<String> getDepartIdsByUsername(String username);

    List<String> getDepartNamesByUsername(String username);

    @Cacheable(value = CacheConstant.SYS_DICT_CACHE,key = "T(com.csii.core.util.TenantContext).getTenantDefaultString() +#code")
    List<DictModel> queryDictItemsByCode(String code);

    List<DictModel> queryTableDictItemsByCode(String table, String text, String code);

    List<DictModel> queryAllDepartBackDictModel();

    List<JSONObject> queryAllDepart(Wrapper wrapper);

    List<DictModel> queryAllDict();

    List<DictModel> queryFilterTableDictInfo(String table, String text, String code, String filterSql);

    List<String> queryTableDictByKeys(String table, String text, String code, String[] keyArray);

    List<ComboModel> queryAllUser();

    JSONObject queryAllUser(String[] userIds, int pageNo, int pageSize);

    List<JSONObject> queryAllUser(Wrapper wrapper);

    List<ComboModel> queryAllRole();

    List<ComboModel> queryAllRole(String[] roleIds);

    List<String> getRoleIdsByUsername(String username);

    String getDepartIdsByOrgCode(String orgCode);

    DictModel getParentDepartId(String departId);

    List<SysDepartModel> getAllSysDepart();

    List<String> getDeptHeadByDepId(String deptId);

    List<LoginUser> queryAllUserByIds(String[] userIds);

    List<LoginUser> queryUserByNames(String[] userNames);
}
